home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-12-17 | 7.9 KB | 208 lines | [TEXT/MPS ] |
- #
- # ****************************************************************************
- #
- # File Name: WordPerfect.vu
- #
- # Contains: Quick look test script for WordPerfect version 2.1
- #
- # Written by: Kevin Avoy, Ken Landreth, Michael Leong, Gil Spencer et al
- #
- # Copyright: © 1993 by Apple Computer, Inc., all rights reserved.
- #
- # ****************************************************************************
- # C h a n g e H i s t o r y (most recent first):
- # ****************************************************************************
- #
- # Vers Date Author Description
- # ---- -------- ------ ---------------------------------------------
- # <6> 9/30/93 KTA Initialize gFileName prior to gApptitle being updated by
- # launchTwitch().
- # <3> 6/16/93 NAGA Renaming InitGlobals(ScriptLevel)to InitGlobals(ScriptLevel)
- # <2> 5/26/93 NAGA Set call to SuiteStart correctly
- # <1+> 5/26/93 NAGA Set call to SuiteStart correctly
- # <1+> 5/25/93 NAGA Adding header and porting old files to follow new standards
- #
- # ****************************************************************************
- #
-
-
-
- ########################################################################
- # External libraries
- #=======================================================================
- Libraries "Output.Lib", "DoTasks.Lib","Draw.Lib","WordProcessor.Lib","UserInterface.Lib", "Font.Lib", "Globals.Lib", "LaunchQuit.Lib", "TCS.Lib";
-
-
- #########################################################################
- ######## Application Specific Tasks
- #########################################################################
-
- #########################################################################
- # InitAppGlobals()
- #========================================================================
- # Author: ML
- # Description: Sets up the tool palette for WordPerfect. This task
- # must be called first.
- # Parameters: None
- # Returns: Nothing
- # Examples: InitAppGlobals()
- #========================================================================
- # History:
- #
- ########################################################################
- task InitAppGlobals()
- begin
-
- logstr("setting up {global gApptitle}'s globals");
- global kClick, kDrag, kMultiDrag, kMultiClickDrag, kMultiClick;
- global kPalDocWind, kPalWind, kPullOffPal, kPopUpPal, kScrollPal;
- global kTabPaletteNum := 1;
- global kAlignPaletteNum := 2;
- global kSpacingPaletteNum := 3;
-
- global gTextStr;
-
- global gPaletteList := {
- { #### Start Palette #1 - Tabs
- {25,31,13,24,0}, # Location of tab palette relative to the window
- kPopUpPal, # Palette type
- {1,12}, # Size of Tool matrix {numElemsWide,numElemsTall}
- {0,13}, # Offset between tools {h,v}
- 0, # Not used at this time
- 0 # Not used at this time
- }, #### End Palette #1
- { #### Start Palette #2 - Alignment
- {71,31,54,24,0}, # Location of alignment palette relative to the window
- kPopUpPal, # Palette type
- {1,5}, # Size of Tool matrix {numElemsWide,numElemsTall}
- {0,14}, # Offset between tools {h,v}
- 0, # Not used at this time
- 0 # Not used at this time
- }, #### End Palette #2
- { #### Start Palette #3 - Line spacing
- {253,31,234,24,0}, # Location of Line spacing palette relative to the window
- kPopUpPal, # Palette type
- {1,3}, # Size of Tool matrix {numElemsWide,numElemsTall}
- {0,14}, # Offset between tools {h,v}
- 0, # Not used at this time
- 0 # Not used at this time
- } #### End Palette #3
- };
-
- ### WordPerfect {Flag, Pattern, Line, Color}
- ### Palette Elements:= Tool#, Pal#, ToolName, ToolType, DblClktoEnd SetAttributes
- global TabLeftTool := { 1, 1, "Tab Left", kClick, 0, {0} };
- global TabCenterTool := { 2, 1, "Tab Center", kClick, 0, {0} };
- global TabRightTool := { 3, 1, "Tab Right", kClick, 0, {0} };
- global TabDecimalTool := { 4, 1, "Tab Decimal", kClick, 0, {0} };
- global TabDotLeftTool := { 5, 1, "Tab Dot Left", kClick, 0, {0} };
- global TabDotCenterTool := { 6, 1, "Tab Dot Center",kClick, 0, {0} };
- global TabDotRightTool := { 7, 1, "Tab Dot Right",kClick, 0, {0} };
- global TabDotDecimalTool := { 8, 1, "Tab Dot Decimal",kClick, 0, {0} };
- global TabVerticalTool := { 9, 1, "Tab Vertical", kClick, 0, {0} };
- global TabClearTool := {12, 1, "Tab Clear", 0, 0, {0} };
- global AlignLeftTool := { 1, 2, "Align Left", 0, 0, {0} };
- global AlignCenterTool := { 2, 2, "Align Center", 0, 0, {0} };
- global AlignRightTool := { 3, 2, "Align Right", 0, 0, {0} };
- global AlignJustifyTool := { 4, 2, "Align Justify",0, 0, {0} };
- global AlignJustifyAllTool :={ 5, 2, "Align Justify All",0, 0, {0} };
- global SingleSpaceTool := { 1, 3, "Single Space", 0, 0, {0} };
- global xSpaceTool := { 2, 3, "1-1/2 Space", 0, 0, {0} };
- global DoubleSpaceTool := { 3, 3, "Double Space", 0, 0, {0} };
-
- global RulerRect:= {74,65,20,74};
-
- global RulerMenuPath := {'Show Ruler','Layout'};
-
- global TabToolList:={ TabClearTool,
- TabLeftTool,
- TabCenterTool,
- TabRightTool,
- TabDecimalTool,
- TabDotLeftTool,
- TabDotCenterTool,
- TabDotRightTool,
- TabDotDecimalTool,
- TabVerticalTool
- };
-
- global OtherToolList:={ AlignLeftTool,
- AlignCenterTool,
- AlignRightTool,
- AlignJustifyTool,
- AlignJustifyAllTool,
- SingleSpaceTool,
- xSpaceTool,
- DoubleSpaceTool
- };
-
- ### font characteristic lists
- global gFontList := {'Helvetica','Courier','Chicago'};
- global gFontSizeList := {'9','10','12','14','18', '24'};
- global gFontStyleList := {'Bold','Italics','Outline', 'Underline','Shadow',
- 'Superscript','Subscript','Redline'};
-
-
- ### Name of the Plain (style) menu item ####
- global gPlainStyle := "Plain Text"; # Plain-Style menu item
-
- ### How to get to the next line
- global gNextLineMethod := 1;
- ### 1 - ReturnKey, 2 - EnterKey, 3 - DownArrow Key, 4 - TabKey, {} - Move/Click, {'Untitled'} - Move relative to the window titled 'Untitled' /Click
-
- ### Does moving to the next line clear all font info
- global gNextLineClearsFontSettings := 0;
-
- end; #InitAppGlobals
-
- #########################################################################
- # Views()
- #========================================================================
- # Author: Jon Marsh x2 8093
- # Description: Change views.
- # Parameters: None
- # Returns: Nothing
- # Examples: Views();
- # Assumptions: None
- # Applications: WordPerfect
- #========================================================================
- # History:
- #
- ########################################################################
- task Views() begin
- LogStr( "Changing Views");
- SelectMenuItem("Show ¶", "Edit");
- SelectMenuItem("Show Codes", "Edit");
- SelectMenuItem("Show Clipboard", "Edit");
- CloseWindow();
- SelectMenuItem("Hide ¶", "Edit");
- SelectMenuItem("Hide Codes", "Edit");
- end;
-
- ################################################################################
- #################### Main script ####################
- ################################################################################
- script WordPerfect (ScriptLevel:= -1)
- begin
- InitGlobals(ScriptLevel);
- InitDraw();
- InitFonts();
- global gAppTitle := 'WordPerfect';
- global gAppVersion := '2'; # version of app you will be running
- global gFileName := "@!@-{gBuildVers}-{gAppTitle}"; #This is used in SaveAs when saving files
- SuiteStart('WordPerfect.vu'); # begin a new test suite
- if LaunchTwitch("{gAppTitle}",gAliasDirectory) # launch or twitch to your app
- begin
- InitAppGlobals();
- (*
- *)
- DoSetUpApp(1,,,,1,1);
- DoText();
- if (gAppTestLevel = 2)
- DoWPTools();
- Views();
- DoWindow();
- DoCloseApp();
- end; # if LaunchTwitch("{gAppTitle}",gAliasDirectory)
- SuiteEnd();
- end; # script WordPerfect